* Retrieves the string basing on string identifier (string_id) or by
* page_id.string_id. It means the strings_id may be specified in 2 ways:
* - as normal string_id - then the string is retrieved from the cached version
* of strings in the current page_id
* - as [page_id].[string_id] - then teh strings is retrieved from the DB by getting
* it from the given page_id. The additional optimization mechanism checks
* if the page_id is not the same, as the current - if it is - the string will still be
* retrieved from the cached version.
* Also in the Params array there can be the item 'lang_id'. If not 'action' has
* been given then the string from specified lang_id (in specified language)
* will be retrieved. This solution is not recommended for common usage
* (e.g. for the whole pages) as this will not use the cached in the constructor
* strings, but will make another query to the DB for the specified query.
* Another item that can be this array is 'action'. This specified special
* actions that should be performed. The special actions can be the following:
* 'normal' - this is default setting. It means that method will act as if this
* item was not given.
* 'translate' - this will couse, that the $StringName will not be the
* string_id, but the string itself. This must be set only together with
* 'lang_id' item. Method will try to find the specified string in the foreign
* (specified in lang_id) language and will retrieve the corresponding string in
* the current language. This solution is not recommended for common usage
* (e.g. for the whole pages) as this will not use the cached in the constructor
* strings, but will make another query to the DB for the specified query.
* Item 'optimization' is used to specify the optimization of the queries -
* if the main load should be performed by the PHP server (by doing more, but
* less complicated queries) or DB server (PHP is sending only one, but
* complicated query). This one is used only together with specified 'lang_id'
* and 'action'=>'translate' - as this performs more operations, then other
* queries. It can have following values:
* 'php' - the default setting, cousing PHP to make 2 (or 3 if the string will
* be found in some other page_id then the current) uncomplicated queries. This
* is recommened if the DB server is the same machine as the PHP server.
* 'db' - this couses PHP to make only 1, but comlicated query. This is
* recommended if the DB server is separate machine, then PHP server. WARNING:
* This will not work with MySQL DB server and Db servers, that does not
* supports nested SELECTs (SELECT ... FROM ... WHERE sth = (SELECT...))
* Another parameters that might be specified in the $Params array are:
* 'ParameterPrefix' - is the prefix string for parameter - default is '&&'
* 'ParameterPostfix' - is the postfix string for parameter - default is '&&'
*
* @param string $StringName string identifier - unique for the page as well as for the strings, that are available on all the pages.
* @param array string $Params string may be parametrized - and the paraters, that will be "inserted" into string may be typen into this array. It means, that &&1&& string will be replaced by 1st array element; string &&2&& will be replaced by 2nd array element; string &&3&& will be replaced by 3rd array element etc.
* @return string retrieved string
*/
function gstr($StringName, $Params = array())
{
if (($returnstring = $this->Strings[$StringName]) == '') {
* Retrieves names of all other languages, not the active.
*
* @return array 2-dimensional array (0..)('id', 'name') for all the languages defined in DB but the current selected one. In case of DB error - returns PEAR_ERROR object.
* Retrievs the META tags that should be added on the top of translated page, so the translated characters will be correctly displayed on client's browser.
*
* @return string with configured in DB META tags for selected language. In case of DB error - returns PEAR_ERROR object.